{extend name="public:base" /}
{block name="action"}
<a href="{:url('create')}" class="btn btn-w-m btn-primary"><i class="fa fa-plus"></i>添加</a>
{/block}

{block name="content"}
<div class="wrapper wrapper-content animated fadeInRight" xmlns="http://www.w3.org/1999/html">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox ">
                <div class="ibox-title">
                    <form method="get">
                        <div class="row">
                            <div class="col-sm-3">
                                <input placeholder="文章标题" value="{$params['query']}" name="query" type="text"
                                       class="form-control form-control">
                            </div>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <select class="form-control m-b" name="type_id">
                                        <option value="">全部</option>
                                        {volist name="new_classes" id="entity"}
                                        {eq name="$entity.id" value="$params.type_id"}
                                        <option value="{$entity.id}" selected>{$entity.name}</option>
                                        {else/}
                                        <option value="{$entity.id}">{$entity.name}</option>
                                        {/eq}
                                        {/volist}
                                    </select>
                                    <div class="input-group-append">
                                        <button type="submit" class="btn btn-sm btn-primary"><i
                                                class="fa fa-search"></i>搜索
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="ibox-content">

                    <div class="table-responsive">
                        <table class="table table-striped datalist-table">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>标题</th>
                                <th>新闻分类</th>
                                <th>推荐</th>
                                <th>创建时间</th>
                                <th>更新时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {notempty name="list"}
                            {volist name="list" id="vo"}
                            <tr>
                                <td>{$vo.id}</td>
                                <td>{$vo.title}</td>
                                <td>{$vo.newsClass.name}</td>
                                <td>{$vo.recommend_txt}</td>
                                <td>{$vo.create_time}</td>
                                <td>{$vo.update_time}</td>
                                <td class="project-actions">
                                    <a href="{:url('edit')}?id={$vo.id}" class="btn btn-warning btn-sm edit-btn"
                                       data-id="{$vo.id}">
                                        <i class="fa fa-edit"></i> 编辑
                                    </a>
                                    <a href="{:url('delete', [],'json')}?id={$vo.id}"
                                       class="btn btn-danger btn-sm ajax-del"><i class="fa fa-trash-o"></i> 删除 </a>
                                </td>
                            </tr>
                            {/volist}
                            {/notempty}
                            </tbody>
                        </table>
                        {$list->render()}
                    </div>
                </div>
            </div>
        </div>
    </div>
    <template>

    </template>
</div>
{/block}
{block name="js"}
{/block}